<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico">
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <link rel="stylesheet" type="text/css" href="/admin/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="/admin/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/style.css" />
    <title>md5</title>
</head>
<body>
<div class="page-container">
    <table class="table table-border table-bordered table-bg">
        <thead>
            <tr>
                <th scope="col" colspan="6">列表</th>
            </tr>
            <tr class="text-c">
                <th width="5%">地址</th>
                <th width="5%">类型</th>
                <th width="5%">姓名</th>
                <th width="10%">密文</th>
                <th width="5%">操作</th>
                <th width="5%">结果</th>
            </tr>
        </thead>
        <tbody>
            <tr class="text-c">
                <td>tianwu</td>
                <td>admin</td>
                <td>张舒萍</td>
                <td><input type="text" class="input-text" name="miwen" value="a9e2e42c721fa0fa1eef8353058a310a"></td>
                <td><button type="button" class="btn btn-success" id="" name="md5">解密</button></td>
                <td id="show"></td>
            </tr>
        </tbody>
    </table>
</div>
<input type="hidden" name="_token" value="{{csrf_token()}}">
</body>
<script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
<script>
    $(function(){
        $("button[name='md5']").click(function(){
            var _this = $(this);
            $.ajax({
                type: 'POST',
                url: '/admin/public/md5',
                data: {'md5':$(_this).closest('td').prev('td').find("input[name='miwen']").val(),'_token':$("input[name='_token']").val()},
                dataType: 'json',
                success: function(data) {
                    if(data == 0){
                        alert('出错了！');
                    }else{
                        console.log(data.data[0]);
                        $(_this).closest('td').next('td').html(data.data[0].plain);
                    }
                },
                error: function(data) {

                },
            });
        });

    });
</script>
</html>